FROM swr.cn-north-4.myhuaweicloud.com/swr-devadv/cangjie:1.0.0-0
WORKDIR /app
EXPOSE 8080

ENV CANGJIE_HOME="/root/cangjie"
ENV PATH="/root/cangjie/bin:/root/cangjie/tools/bin:/root/.cjpm/bin:$PATH"
ENV LD_LIBRARY_PATH="/root/cangjie/runtime/lib/linux_x86_64_llvm:/root/cangjie/tools/lib"
ENV CANGJIE_STDX_PATH="/root/stdx_1001"
ENV CANGJIE_STDX="/root/stdx_1001/linux_x86_64_llvm/static/stdx"

COPY . .
WORKDIR src/contrib/text_list_api/
RUN cjpm update
RUN cjpm build

ENTRYPOINT ["/app/src/contrib/text_list_api/target/release/bin/main"]